package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
        PrintStream printStream = System.out;
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        List<LibraryBook> bookList = new ArrayList<LibraryBook>();

        bookList.add(new LibraryBook("The Wizard of Oz"));
        bookList.add(new LibraryBook("Hunger Games"));
        bookList.add(new LibraryBook("Ender's Game"));

        Map options = new HashMap<String, String>();

        options.put("1", "1 - List available books");
        options.put("2", "2 - Checkout A Book");
        options.put("3", "3 - Return A Book");
        options.put("4", "4 - Quit");

        CheckoutBookCommand checkoutCommand = new CheckoutBookCommand(printStream, bufferedReader, bookList);
        ListBookCommand listBookCommand = new ListBookCommand(printStream, bookList);
        ReturnBookCommand returnBookCommand = new ReturnBookCommand(printStream, bufferedReader, bookList);
        Menu menu = new Menu(printStream, bufferedReader, listBookCommand, checkoutCommand, returnBookCommand, options);
        new Biblioteca(printStream, bookList, bufferedReader, menu).run();
    }
}
